package com.lsh.oms.api.model.order.delivery;

import com.lsh.oms.api.common.constants.ValidationConstants;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 发货单头
 *
 * @author miaozhuang
 * @date 18/6/23
 */
@Setter
@Getter
@NoArgsConstructor
@ToString
public class OrderSendHeadDTO implements Serializable {

    private static final long serialVersionUID = -4858620054296516188L;

    @NotNull(message = ValidationConstants.NOT_NULL)
    @Min(value = 0, message = ValidationConstants.ERROR)
    private Long order_id;

    private String type;

    private String system;
    /**
     * 运单号
     */
    private String waybill_id;
    /**
     * 发货信息
     */
    private String driver_info;
    /**
     * 车辆类型
     */
    private String car_type;
    /**
     * 类型描述
     */
    private String car_type_desc;
    /**
     * 承运商编码
     */
    private String carrier_code;
    /**
     * 承运商名称
     */
    private String carrier_name;
    /**
     * 创建时间
     */
    private Integer create_time;
    /**
     * 拣货时间
     */
    private Integer pick_time;
    /**
     * 发货时间
     */
    @NotNull(message = ValidationConstants.NOT_NULL)
    @Min(value = 0, message = ValidationConstants.ERROR)
    private Integer delivery_time;
    /**
     *
     */
    @NotBlank(message = ValidationConstants.NOT_BLANK)
    private String so_user_id;
    /**
     * socodes
     */
    @NotBlank(message = ValidationConstants.NOT_BLANK)
    private String out_order_id;
    /**
     * obdCodes
     */
    @NotBlank(message = ValidationConstants.NOT_BLANK)
    private String bill_id;
    /**
     * 箱数
     */
    @NotNull(message = ValidationConstants.NOT_NULL)
    @DecimalMin(value = "0", message = ValidationConstants.ERROR)
    private BigDecimal box_num;
    /**
     * 周转箱数
     */
    @NotNull(message = ValidationConstants.NOT_NULL)
    @DecimalMin(value = "0", message = ValidationConstants.ERROR)
    private BigDecimal turnoverbox_num;
    /**
     * 散箱数
     */
    @NotNull(message = ValidationConstants.NOT_NULL)
    @DecimalMin(value = "0", message = ValidationConstants.ERROR)
    private BigDecimal scattered_box_num;
    /**
     * 含税金额
     */
    @NotNull(message = ValidationConstants.NOT_NULL)
    @DecimalMin(value = "0", message = ValidationConstants.ERROR)
    private BigDecimal amount;
    /**
     * 未税金额
     */
    @NotNull(message = ValidationConstants.NOT_NULL)
    @DecimalMin(value = "0", message = ValidationConstants.ERROR)
    private BigDecimal nt_amount;
    /**
     * 发货缺交数量
     */
    private BigDecimal lack_num;

    @NotBlank(message = ValidationConstants.NOT_BLANK)
    private String warehouse_id;

    @NotBlank(message = ValidationConstants.NOT_BLANK)
    private String warehouse_name;

    private String obd_order_picking_info;

    private Integer receipt_flag;

//   2019-12-23 peter

    private String collect_code;

    @NotBlank(message = ValidationConstants.NOT_BLANK)
    private String provider_id;
    @NotBlank(message = ValidationConstants.NOT_BLANK)
    private String order_dc;

    @NotNull(message = ValidationConstants.NOT_NULL)
    private Integer delivery_type;
    @NotNull(message = ValidationConstants.NOT_NULL)
    private Integer sale_model;
    /**
     * json
     */
    @NotBlank(message = ValidationConstants.NOT_BLANK)
    private String obd_ext;

    /**
     * 发货详情
     */
    @NotEmpty(message = ValidationConstants.NOT_EMPTY)
    private List<OrderSendDetailDTO> items;
}
